package com.jade.store.wechat.biz.service.msg;

import com.jade.store.wechat.biz.common.WxConstantUtil;
import com.jade.store.wechat.biz.protocol.msg.SendMsgReq;
import com.jade.store.wechat.biz.protocol.msg.SetIndustryReq;
import com.jade.store.wechat.biz.service.BaseWxService;

/**
 *
 * User: jinya
 * Date: 2016/12/13
 * Time: 14:30
 * TEL :17701640710   MAIL:2009_jinya@163.com
 * To change this template use File | Settings | File Templates.
 */
public class SendMsgService extends BaseWxService {

    public SendMsgService(String appid) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
        super(appid,WxConstantUtil.api_send_message_custom);
    }

    /**
     * 发送文本消息
     * @param req 这个数据对象里面包含了API要求提交的各种数据字段
     * @return API返回的数据
     * @throws Exception
     */
    public String requestText(SendMsgReq req) throws Exception {
        String responseString = sendJsonPost(req);
        return responseString;
    }
    /**
     * 发送图片消息
     * @param req 这个数据对象里面包含了API要求提交的各种数据字段
     * @return API返回的数据
     * @throws Exception
     */
    public String requestImage(SendMsgReq req) throws Exception {
        String responseString = sendJsonPost(req);
        return responseString;
    }
}
